<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>网站后台管理模版</title>
		<link rel="stylesheet" type="text/css" href="../../static/admin/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="../../static/admin/css/admin.css" />
	</head>

	<body>
		<div class="layui-tab page-content-wrap">
			<ul class="layui-tab-title">
				<li class="layui-this">站点配置</li>
				<li>支付配置</li>
			</ul>
			<div class="layui-tab-content">
				<!--站点配置-->
				<div class="layui-tab-item layui-show">
					<form class="layui-form" style="width: 90%;padding-top: 20px;">
						<div class="layui-form-item">
							<label class="layui-form-label">网站名称：</label>
							<div class="layui-input-block">
								<input type="text" name="webName" autocomplete="off" class="layui-input" th:value="${web.webName}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">网站域名：</label>
							<div class="layui-input-block">
								<input type="text" name="webUrl" autocomplete="off" class="layui-input" th:value="${web.webUrl}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">网站关键词：</label>
							<div class="layui-input-block">
								<input type="text" name="webKeywords" required lay-verify="required"   autocomplete="off" class="layui-input" th:value="${web.webKeywords}">
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label">网站简介：</label>
							<div class="layui-input-block">
								<textarea name="webDes" placeholder="请输入网站简介" class="layui-textarea" th:text="${web.webDes}"></textarea>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-input-block">
								<button class="layui-btn layui-btn-normal" lay-submit lay-filter="siteInfo">立即提交</button>
							</div>
						</div>
					</form>
				</div>
				<!--SEO配置-->
				<div class="layui-tab-item">
					<form class="layui-form" style="width: 90%;padding-top: 20px;">
						<div class="layui-form-item">
							<label class="layui-form-label">Token：</label>
							<div class="layui-input-block">
								<input type="text" name="webPayToken" placeholder="请输入Token" autocomplete="off" class="layui-input" th:value="${web.webPayToken}">
							</div>
						</div>
						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label">PAYID：</label>
							<div class="layui-input-block">
								<input type="text" name="webPayId" placeholder="请输入PayID" autocomplete="off" class="layui-input" th:value="${web.webPayId}">
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-input-block">
								<button class="layui-btn layui-btn-normal" lay-submit lay-filter="payInfo">立即提交</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<script src="../../static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script>
			//Demo
			layui.use(['form', 'element','jquery'], function() {
				var form = layui.form();
				var element = layui.element();
				var $ = layui.jquery;
				form.render();
				//监听信息提交
				form.on('submit(siteInfo)', function(data) {
					//layer.msg(JSON.stringify(data.field));
					$.ajax({
						url:"/admin/ajax/editWeb",
						type:"POST",
						data:data.field,
						success:function (res) {
							if (res == 1){
								layer.msg("修改成功",{end:function () {
										location.reload();
									}});
							}
						}
					});
					return false;
				});
				//监听seo提交
				form.on('submit(payInfo)', function(data) {
					//layer.msg(JSON.stringify(data.field));
					$.ajax({
						url:"/admin/ajax/editPay",
						type:"POST",
						data:data.field,
						success:function (res) {
							if (res == 1){
								layer.msg("修改成功",{end:function () {
										location.reload();
									}});
							}
						}
					});
					return false;
				});
			});
		</script>
	</body>

</html>